package com.jd.org.domain;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.jd.basic.domain.BaseDomain;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.util.ArrayList;
import java.util.List;

@Data
public class Department extends BaseDomain {
    //部门ID
//    private Long id;
    //部门编号
    @NotBlank(message = "部门编号不能为空")
    private String sn;
    //部门名称
    @NotBlank(message = "部门名称不能为空")
    private String name;
    //部门路径
    private String dirPath;
    //部门状态：1启用,0禁用
    private Integer state = 1;
    //部门经理ID
    private Long managerId;
    //上级部门ID
    private Long parentId;
    // 关联查询
    private Employee manager; // 部门经理
    private Department parent; // 上级部门
    // 级联框数据
    @JsonInclude(JsonInclude.Include.NON_EMPTY) // 没有数据就不显示
    private List<Department> children = new ArrayList<>();
}